<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

  <body>
    <div id="app"></div>
    <template id="my-app">
    <h2>选择你喜欢的城市</h2>
    <select v-model="cities" multiple>
    <option value="南京">南京市</option>
    <option value="北京">北京市</option>
    <option value="上海">上海市</option>
    <option value="广州">广州市</option>
    </select>
    <div>
      你喜欢的城市有：
<ul>
<li v-for="city in cities" :key="city">{{city}}
</li>
</ul>
</div>
</template>
<script src="../lib/js/vue.js"></script>
<script>
const app = Vue.createApp({
template: '#my-app',
data: function () {
return {
cities: ['北京']
}
}
})
app.mount('#app')
</script>
</body>
</html>